package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.ProcessLogDao;
import cn.topevery.garden.entity.po.ProcessLog;
import cn.topevery.garden.entity.query.ProcessLogQuery;
import cn.topevery.garden.entity.vo.ProcessLogVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 过程日志信息表
 *
 * @author code-generate
 * @date 2022-02-15
 */
@Service
public class ProcessLogLogic extends BaseLogic<ProcessLog> {
    @Autowired
    ProcessLogDao processLogDao;

    @Override
    public BaseEntityDao<ProcessLog, Integer> getDao() {
        return processLogDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<ProcessLogVO> listPage(ProcessLogQuery query) {
        return processLogDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        processLogDao.deleteBatchById(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param processLog 实体
     */
    public void saveOrUpdate(String userId, ProcessLog processLog){
        processLogDao.saveOrUpdate(userId,processLog);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public ProcessLog getEntityByColumn(String key, String value) {
        return processLogDao.getEntityByColumn(key, value);
    }
}
